import { createApp } from "vue";
import App from "./App.vue";
import router from "./router";

// 引入vuex
import store from "./store/store";

// 引入全局路由规则
import "./router/permission";

// axios
import VueAxios from "vue-axios";
import axios from "axios";

// 引入Element-Plus
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
// 引入Element-Plus-icon
import * as ElementPlusIconsVue from "@element-plus/icons-vue";

// 定义全局CSS默认
import "./assets/main.css";

const app = createApp(App);

// 载入所有icon
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}

app.use(VueAxios, axios);
app.use(router);
app.use(ElementPlus);
app.use(store);

app.mount("#app");
